<?php

namespace app\admin\middleware;

class Auth
{
    public function handle($request, \Closure $next){

        if(!session(config("admin.session_admin")) && !preg_match("/login/", $request->pathinfo()) && !preg_match("/verify/", $request->pathinfo())){

            return redirect(url("login/index"));

        }

        $response = $next($request);



        return $response;
    }

    public function end()
    {

    }
}